/***********************************
 *           3/24/2014             *
 *       by Meow dev (arm genesis) *
 *                                 *
 ***********************************/
package com.meow.dev.constante;

import com.sun.jna.NativeLong;

public interface ErrorCode {

	// Message informing of the successful execution of commands
	public static NativeLong RUN_SUCCESS = new NativeLong(1);

	// Error that the device does not support the relevant command
	public static NativeLong RUNERR_NOSUPPORT = new NativeLong(0);

	// not connected
	public static NativeLong RUNERR_NO_OPEN_COMM = new NativeLong(-2);

	// Error that the input license does not accord when
	// connecting with the device
	public static NativeLong RUNERR_MIS_PASSWORD = new NativeLong(-10);

	// RUNERR_DATAARRAY_END
	public static NativeLong RUNERR_DATAARRAY_END = new NativeLong(-7);

	// Error that the data do not exist
	public static NativeLong RUNERR_DATAARRAY_NONE = new NativeLong(-8);

	// -6 RUNERR_NON_CARRYOUT Error that the command has not been executed
	// correctly
	public static NativeLong RUNERR_NON_CARRYOUT = new NativeLong(-6);

	// -12 RUNERR_DATADOUBLE
	// Error that the registration number to be enrolled is
	// already stored in the database of the device
	public static NativeLong RUNERR_DATADOUBLE = new NativeLong(-12);
	public static NativeLong DATA_EXSIT = new NativeLong(-12);

	public enum ERRORTYPE {
		MSG, CONNECT_ERROR;
		private String msg = "";

		public String getMsg(int error) {
			switch (error) {
			case 1:
				msg = "RUN_SUCCESS";
				break;
			case 2:
				msg = "CANNOT_CONNECT";
				break;
			default:
				msg = "NO_MSG";
				break;
			}
			return msg;
		}
	}

}
